From e827ed5bab2e17639905660b51f8037343dde609 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 21 Aug 2007 21:05:53 +0000 Subject: [PATCH] garmin_txt: Fix MSVC crash with timestamps lt zero. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2973 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/garmin_txt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gpsbabel/garmin_txt.c b/gpsbabel/garmin_txt.c index a31e11815..a8122ca1c 100644 --- a/gpsbabel/garmin_txt.c +++ b/gpsbabel/garmin_txt.c @@ -358,6 +358,10 @@ print_date_and_time(const time_t time, const int time_only) struct tm tm; char tbuf[32]; + if (time < 0) { + gbfprintf(fout, "\t"); + return; + } if (time_only) { tm = *gmtime(&time); snprintf(tbuf, sizeof(tbuf), "%d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec); -- 2.30.2